package com.reqresp; /**
 * @author wzm
 * @create 2023-09-19 16:47
 * project_name:javaweb2308
 */

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet("/rs01")
public class Servlet001 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("我是窗口A,欢迎光临");
        System.out.println("给你一张缴费单，你去找B办理");

        //request可以携带数据
        request.setAttribute("jfd","150元");

        //请求的转发
        RequestDispatcher dispatcher = request.getRequestDispatcher("/rs02");
        //走向目的地  携带单据
        dispatcher.forward(request,response);
    }
}
